home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
FPE
/
FPE.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
5KB
|
189 lines
(*************************************************************************
$RCSfile: FPE.mod $
Description: Frank's Programming Environment
A programming utility designed to integrate seperate
programming tools (editor, compiler, linker, etc.) into a
single system. It also provides a simple source code
manager.
Requires: asl.library intuisup.library
Created by: fjc (Frank Copeland)
$Revision: 1.16 $
$Author: fjc $
$Date: 1995/06/29 18:49:53 $
Copyright © 1993-1995, Frank Copeland.
This file is part of FPE.
See FPE.doc for conditions of use and distribution.
Log entries are at the end of the file.
*************************************************************************)
<* STANDARD- *> <*$ NilChk- *>
MODULE FPE;
IMPORT
SYS := SYSTEM, Kernel, e := Exec, d := Dos, ASL, is := IntuiSup, Data,
dlg := FPEDlg, Errors, wb := Workbench, du := DosUtil, u := Utility;
CONST VersionTag = "$VER: FPE 1.12 (21.6.95)";
(* -- Command line template and parsing ------------------------------- *)
CONST
template = "PROJECT";
optPROJECT = 0;
optCount = 1;
VAR
rdArgs : d.RDArgsPtr;
args : RECORD [2] (d.ArgsStruct)
project : d.ArgString
END;
(*
** Lock on starting directory when run from Workbench.
*)
VAR
startDir : d.FileLockPtr;
(*------------------------------------*)
PROCEDURE* Cleanup (VAR rc : LONGINT);
VAR oldDir : d.FileLockPtr;
BEGIN (* Cleanup *)
IF rdArgs # NIL THEN
d.FreeArgs (rdArgs);
d.FreeDosObject (d.rdArgs, rdArgs);
rdArgs := NIL
END;
IF startDir # NIL THEN
oldDir := d.CurrentDir (startDir);
d.UnLock (Data.currentDir);
END
END Cleanup;
(*------------------------------------*)
PROCEDURE Init ();
VAR
programName, pathPart : e.LSTRPTR;
programNameIndex : INTEGER;
ignore : d.FileLockPtr;
wbStartup : wb.WBStartupPtr;
me : d.ProcessPtr;
BEGIN (* Init *)
ASSERT (ASL.base # NIL, 100);
ASSERT (is.base # NIL, 100);
rdArgs := d.AllocDosObjectTags (d.rdArgs, u.end);
ASSERT (rdArgs # NIL, 132);
Kernel.SetCleanup (Cleanup);
Data.Init();
dlg.Init();
IF Kernel.fromWorkbench THEN
wbStartup := SYS.VAL (wb.WBStartupPtr, Kernel.WBenchMsg);
IF wbStartup.numArgs = 1 THEN
programNameIndex := 0;
Data.currentDir := d.DupLock (wbStartup.argList [0].lock);
ELSIF wbStartup.numArgs = 2 THEN
programNameIndex := 1;
Data.currentDir := d.DupLock (wbStartup.argList [1].lock);
ELSE
Errors.Abort ("FPE - too many arguments")
END;
programName := wbStartup.argList [programNameIndex].name;
IF programName = NIL THEN Data.programName := "";
ELSE COPY (programName^, Data.programName)
END
ELSE
IF d.ReadArgs (template, args, rdArgs) = NIL THEN
ASSERT (d.PrintFault (d.IoErr(), "ReadArgs"));
HALT (d.warn)
END;
IF args.project # NIL THEN
programName := d.FilePart (args.project^);
COPY (programName^, Data.programName);
pathPart := d.PathPart (args.project^);
IF pathPart = args.project THEN
Data.currentDir := d.Lock (e.EMPTYSTR, d.sharedLock);
ELSE
pathPart [0] := 0X;
Data.currentDir := d.Lock (args.project^, d.sharedLock)
END
ELSE
Data.programName := "";
Data.currentDir := d.Lock (e.EMPTYSTR, d.sharedLock)
END
END;
startDir := d.CurrentDir (Data.currentDir);
ASSERT ( d.NameFromLock ( Data.currentDir,
Data.currentPath,
LEN(Data.currentPath) - 1) )
END Init;
(*------------------------------------*)
PROCEDURE Main ();
BEGIN (* Main *)
dlg.Open ();
dlg.Start ();
END Main;
BEGIN (* FPE *)
Errors.Init;
Init();
Main();
END FPE.
(***************************************************************************
$Log: FPE.mod $
Revision 1.16 1995/06/29 18:49:53 fjc
- Release 1.6
Revision 1.15 1995/06/15 18:26:19 fjc
- Bumped revision date
Revision 1.14 1995/06/04 22:45:26 fjc
- Fixed Enforcer hit in argument parsing code.
Revision 1.13 1995/05/08 16:42:32 fjc
*** empty log message ***
Revision 1.12 1995/02/07 20:14:29 fjc
- Release 1.5 update 1
Revision 1.11 1995/01/26 00:15:33 fjc
- Release 1.5
Revision 1.10 1994/09/25 18:20:54 fjc
- Uses new syntax for external code declarations
Revision 1.5 1994/06/04 23:49:52 fjc
- Changed to use new Amiga interface
0.6 (06-Sep-93) General code rework and tidy-up
Changed the way module Data handles tools.
Changed the tool dialog to conform.
General improvements.
0.5 (25-Jul-93) First Oberon version, renamed to FPE.
0.0 - 0.4 Early versions written in Modula 2 and
named M2Org.
***************************************************************************)